<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET;?>">
<title>本地生活</title>
<link href="/Public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile"/>
<script type="text/javascript" src="/Public/static/jquery.js"></script>
<script type="text/javascript" src="/Public/static/jquery.validation.min.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/Public/admin/js/admincp.js"></script>
<script type="text/javascript" src="/Public/admin/js/jquery.tooltip.js"></script>
<script language="javascript">
var SiteUrl = '<?php echo (C("SiteUrl")); ?>';
var AdminUrl = SiteUrl+'/<?php echo (MODULE_NAME); ?>';
</script>
</head><body>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>栏目列表</h3>
      <ul class="tab-base">
         <li><a href="<?php echo U('Setting/nav');?>"><span>管理</span></a></li>
        <li><a href="JavaScript:void(0);" class="current"><span>添加</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="add_form" method="post" action="<?php echo U('');?>" enctype="multipart/form-data" >
    <table class="table tb-type2 nobdb">
      <tbody>
      <input type="hidden" name="id" value="<?php echo ($info['id']); ?>" />
      <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="cid">导航分类:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform">
              <select id="cid" name="cid">
                  <?php if(is_array($cat)): $i = 0; $__LIST__ = $cat;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['navcid']); ?>" <?php if($info['cid'] == $v['navcid']): ?>selected<?php endif; ?> ><?php echo ($v['name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
              </select>
          </td>
          <td class="vatop tips"></td>
      </tr>

      <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="parentid">上级导航:</label></td>
      </tr>
      <tr class="noborder">
          <td class="vatop rowform">
              <select id="parentid" name="parentid">
                  <option value="0">顶级导航</option>
                  <?php if(is_array($parentid)): $i = 0; $__LIST__ = $parentid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v['id']); ?>" <?php if($info['parentid'] == $v['id']): ?>selected<?php endif; ?> ><?php echo ($v['label']); ?></option>
                     <!-- <?php if(is_array($v['_child'])): $i = 0; $__LIST__ = $v['_child'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vv): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vv['id']); ?>">|-&#45;&#45;<?php echo ($vv['label']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>--><?php endforeach; endif; else: echo "" ;endif; ?>
              </select>
          </td>
          <td class="vatop tips"></td>
      </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="label">导航标题:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" id="label" name="label" value="<?php echo ($info['label']); ?>" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
            <td colspan="2" class="required"><label class="validation" for="href">导航链接:</label></td>
        </tr>
        <tr class="noborder">
            <td class="vatop rowform"><input type="text" id="href" name="href" value="<?php echo ($info['href']); ?>" class="txt"></td>
            <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
            <td colspan="2" class="required"><label class="validation" for="target">打开方式:</label></td>
        </tr>
        <tr class="noborder">
            <td class="vatop rowform">
                <select id="target" name="target">
                    <option value="_blank" <?php if($info['target'] == '_blank'): ?>selected<?php endif; ?> >新窗口</option>
                    <option value="_self"  <?php if($info['target'] == '_self'): ?>selected<?php endif; ?> >当前窗口</option>
                </select>
            </td>
            <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
            <td colspan="2" class="required"><label class="validation" for="icon">导航图标:</label></td>
        </tr>
        <tr class="noborder">
            <td class="vatop rowform"><input type="text" id="icon" name="icon" value="<?php echo ($info['icon']); ?>" class="txt"></td>
            <td class="vatop tips"></td>
        </tr>

         <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="order">排序:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" id="order" name="order" value="<?php echo ($info['order']); ?>" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

      </tbody>
      <tfoot>
        <tr class="tfoot">
          <td colspan="2"><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>保存</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script>
//按钮先执行验证再提交表
$(function(){$("#submitBtn").click(function(){
    if($("#add_form").valid()){
     $("#add_form").submit();
	}
	});
});
$("#link_image").change(function(){
    $("#txt_link_image").val($(this).val());
});
</script> 
</body></html>